<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>模板</title>
  </head>
  <body>
    <div id="app"></div>
  </body>
  <script src="../node_modules/vue/dist/vue.js"></script>
  <script src="../node_modules/axios/dist/axios.js"></script>
  <script>
    //http://120.76.247.5:2002/user/list?page=1&pagesize=20&search=%7B%7D

    new Vue({
      el: "#app",
      data: {},

      methods: {
        fetch() {
          let p = axios.get(
            "http://120.76.247.5:2002/user/list?page=1&pagesize=20&search=%7B%7D"
          );
          // console.log(p);
          p.then((res) => {
            console.log(res.data, 666);
          }).catch((err) => {
            console.log(err);
          });
        },
      },

      //发送ajax
      created() {
        this.fetch(); //一进入页面就发起请求
      },
    });
  </script>
</html>
